﻿@model IEnumerable<vnMcdonald.Models.Product>
        
            <section id="selling-product" class="title"><h3>Món ăn mới nhất</h3></section>
    	    
            <section id="jms-slideshow" class="jms-slideshow jms-fixedfull">           
            @{
                if(Model.Count() > 0){
                    var j = 0;
                   foreach (var item in Model)
                   {
                       j++;
                       
                       <div class="step" 
                        @if (j == 1 || j == 6)
                        {}else
                            if (j == 2 || j == 7) { 
                                @: data-y="500" data-scale="0.4" data-rotate-x="30" 
                            }else
                                if (j == 3 || j == 8) { 
                                    @: data-x="2000" data-z="3000" data-rotate="170" 
                                }else
                                    if (j == 4 || j == 9) { 
                                        @: data-x="3000"
                                    }else{
                                        @: data-x="4500" data-z="1000" data-rotate-y="45" 
                                    }>
                            <div class="jms-content">
						        <h3>@Html.DisplayFor(modelItem => item.Name)</h3>
						        <p>@Html.DisplayFor(modelItem => item.Description)</p>
						        @Ajax.ActionLink("Đặt món", "AddCart", "Cart", new { ProductId = item.ProductId }, new AjaxOptions
                                {
                                    HttpMethod = "Post",
                                    OnSuccess = "onSuccess"
                                }, new { @class = "jms-link" })
                                <span class="price">@Html.DisplayFor(modelItem => item.Price) VNĐ</span>
					            </div>
					        <img src="@item.Images.OrderBy(im => im.Order).FirstOrDefault().Src" alt="@item.Images.OrderBy(im => im.Order).FirstOrDefault().Name" />
                       </div>   
                   }
                }
                else
                {
                    <div class="step"></div>
                }
            }
            </section>